home *** CD-ROM | disk | FTP | other *** search
- /* Thanks to Kevin Sherman for allowing me to include
- this door in the MaxRexx distribution
- If you have any doors that you would like included
- please feel free to E-mail Ian Chapman. See MaxRexx
- docs.
-
- Original version by Basil
- MaxRexx conversion by Kevin Sherman
-
- Minimum MaxRexx Version: 1.2
- */
- line=arg(1)
- port='ADDRESS MAXSERVE'line
- Interpret port
- OPTIONS RESULTS
- IF ~SHOW(l,'rexxsupport.library') THEN CALL ADDLIB('rexxsupport.library',0,-30,0)
- IF ~SHOW(l,'rexxarplib.library') THEN CALL ADDLIB('rexxarplib.library',0,-30,0)
- START:
-
- $CLS
- $PRINTLN " Introducing"
- $PRINTLN " PIGGY Version 0.1 (MaxsBBS version)"
- $NEWLINE
- $PRINTLN " by Kevin Sherman"
- $NEWLINE
- $PRINTLN " Original game & concept"
- $PRINTLN " by Basil Barnes"
- $NEWLINE
- $PRINTLN " A very adictive game of dice."
- $NEWLINE
- $NEWLINE
- $PRINT "Continue, quit, or help? Enter=C/h/q: "
- $HOTKEY
- answer = UPPER(D2C(RESULT))
- SELECT
- WHEN answer = "C" | c2d(answer) = 13 THEN
- DO
- DROP answer
- COMPUTERTOTAL = 0
- USERTOTAL = 0
- CALL RANDOM(,, TIME(s))
- beginer = RANDOM(1,2)
- IF beginer = 1 THEN
- DO
- $NEWLINE
- $PRINTLN "I'll go first this time."
- firstplayer = COMPUTER
- CALL DELAY(200)
- END
- ELSE
- DO
- $NEWLINE
- $PRINTLN "You go first this time."
- firstplayer = USER
- CALL DELAY(200)
- END
- esc = x2c('1B')
- player = firstplayer
- quote.1 = "Come on, baby needs a new pair of shoes!"
- quote.2 = "And the dice say....."
- quote.3 = "One more time with fealing."
- quote.4 = "Hay, are these dice loaded!?!?!"
- quote.5 = "Ooooohhhhhh, I'm HOT tonight!"
- quote.6 = "Come on baby give be those boxcars!"
- quote.7 = "Gotta be cool now, gotta take care...."
- quote.8 = "Think positive thoughts. The dice are my friend. The dice are my..."
- quote.9 = "And there coming out of there shoot...."
- quote.10 = "Look out there hot stuff coming through...."
- quote.11 = "Please GOD give me a good roll and I'll never ask for anything again."
- quote.12 = "Rattle, rattle, rattle and the dice say...."
- quote.13 = "You sure your not cheating?"
- quote.14 = "Come on, come on... Looking for that hot streak!"
- quote.15 = "Like shooting fish in a pond."
- quote.16 = "Oooh, maybe I should't roll this time."
- quote.17 = "Fealing lucky punk? Well do you?!"
- quote.18 = "Is it hot in here or is it just the dice?"
- quote.19 = "What were the rules again?"
- quote.20 = "OK, just one more time."
- DO FOREVER
- IF player = "COMPUTER" THEN CALL computerroll
- IF player = "USER" THEN CALL userroll
- END
- END
- WHEN answer = "H" THEN
- DO
- DROP answer
- $CLS
- $PRINTLN "The object of the game is to be the first one to reach 150 points by adding"
- $PRINTLN "the roll of the dice together. But beware the player that is second always"
- $PRINTLN "has the last roll."
- $NEWLINE
- $PRINT "Enter to continue. "
- $HOTKEY
- CALL START
- END
- WHEN answer = "Q" THEN
- DO
- $END
- EXIT
- END
- OTHERWISE CALL START
- END
-
- COMPUTERROLL:
-
- IF USERTOTAL >= 150 & firstplayer = "COMPUTER" THEN CALL game_end
- IF COMPUTERTOTAL >= 150 & firstplayer = "USER" THEN CALL game_end
- rolltotal = 0
- DO x = 1 TO RANDOM(2,10)
- IF USERTOTAL < 150 THEN
- DO
- call show_dice
- SELECT
- WHEN roll = 2 THEN
- DO
- $PRINTLN "Drat!! I rolled snake eyes I start back at 0"
- COMPUTERTOTAL = 0
- player = user
- CALL DELAY(200)
- RETURN
- END
- WHEN dice.1 = 1 | dice.2 = 1 THEN
- DO
- $PRINTLN "I rolled a one. My turn is over."
- player = user
- CALL DELAY(200)
- RETURN
- END
- WHEN COMPUTERTOTAL + rolltotal > 150 & firstplayer = "USER" THEN
- DO
- COMPUTERTOTAL = COMPUTERTOTAL + rolltotal
- CALL DELAY(200)
- CALL game_end
- END
- OTHERWISE CALL DELAY(100)
- END
- END
- ELSE
- DO WHILE COMPUTERTOTAL + rolltotal < USERTOTAL
- CALL show_dice
- SELECT
- WHEN roll = 2 THEN
- DO
- COMPUTERTOTAL = 0
- $PRINTLN "Ahhhh!! I rolled snake eyes!! I lost big time. You lucky stiff."
- CALL DELAY(100)
- CALL game_end
- END
- WHEN dice.1 = 1 | dice.2 = 1 THEN
- DO
- $PRINTLN "Not Now! Not a ONE! Ahhhhh. You beat me."
- CALL DELAY(100)
- CALL game_end
- END
- WHEN COMPUTERTOTAL + rolltotal > playertotal THEN
- DO
- COMPUTERTOTAL = COMPUTERTOTAL + rolltotal
- $PRINTLN "Hehehehe. Your not piggy enough, I won!"
- CALL DELAY(100)
- CALL game_end
- END
- OTHERWISE CALL DELAY(100)
- END
- END
- END
- COMPUTERTOTAL = rolltotal + COMPUTERTOTAL
- IF COMPUTERTOTAL >= 150 THEN
- DO
- $PRINTLN "OK, it's do or die time for you now!"
- player = user
- CALL DELAY(200)
- RETURN
- END
- $PRINTLN "That's it for me this time."
- player = user
- CALL DELAY(200)
- RETURN
-
- USERROLL:
-
- rolltotal = 0
- $CLS
- $PRINTLN "Game Totals: Computer:" COMPUTERTOTAL " You:" USERTOTAL " First player was" firstplayer
- $NEWLINE
- $PRINT "Would you like to roll the dice? Enter=Y/n/q: "
- $HOTKEY
- DO FOREVER
- answer = UPPER(D2C(RESULT))
- SELECT
- WHEN answer = "N" THEN
- DO
- DROP answer
- USERTOTAL = rolltotal + USERTOTAL
- IF USERTOTAL >= 150 & firstplayer = "COMPUTER" THEN CALL game_end
- SELECT
- WHEN COMPUTERTOTAL >= 150 THEN
- DO
- IF COMPUTERTOTAL > USERTOTAL THEN $PRINTLN "Giving up are you? Good choice, sucker."
- CALL DELAY(200)
- CALL game_end
- END
- WHEN USERTOTAL >= 150 THEN
- DO
- $PRINTLN "YIPES! It's do or die time now!"
- player = computer
- CALL DELAY(200)
- RETURN
- END
- OTHERWISE player = computer
- END
- RETURN
- END
- WHEN answer = "Q" THEN
- DO
- DROP answer
- $NEWLINE
- $PRINTLN "Chicken, try and play again when you have more guts."
- CALL DELAY(300)
- $END
- EXIT
- END
- WHEN answer = "Y" | RESULT = 13 THEN
- DO
- DROP answer
- call show_dice
- SELECT
- WHEN roll = 2 THEN
- DO
- $PRINTLN "Tough break, you rolled snake eyes you start back at 0."
- USERTOTAL = 0
- IF COMPUTERTOTAL > 150 THEN
- DO
- $PRINTLN "Hehehehe, that roll couldn't have come at a worse time."
- $PRINTLN "Man I beat you bad! You shouldn't have been so PIGGY."
- CALL DELAY(200)
- CALL game_end
- END
- player = computer
- CALL DELAY(200)
- RETURN
- END
- WHEN dice.1 = 1 | dice.2 = 1 THEN
- DO
- IF COMPUTERTOTAL > 150 THEN
- DO
- $PRINTLN "Aaawwww, such bad luck. Well that is what you get for being so PIGGY."
- CALL DELAY(200)
- CALL game_end
- END
- $PRINTLN "You rolled a one, my turn now."
- player = computer
- CALL DELAY(200)
- RETURN
- END
- OTHERWISE NOP
- END
- END
- OTHERWISE
- DO
- $CLS
- $PRINTLN "Game Totals: Computer:" COMPUTERTOTAL " You:" USERTOTAL " First player was" firstplayer
- $NEWLINE
- $PRINT "*"answer"* Is not one of the options, roll the dice? Enter=Y/n/q: "
- $HOTKEY
- ITERATE
- END
- END
- $PRINT "Want to roll again? Enter=Y/n/q: "
- $HOTKEY
- END
-
- SHOW_DICE:
- CALL RANDOM(,, TIME(s))
- dice.1 = RANDOM(1, 6)
- dice.2 = RANDOM(1, 6)
- roll = dice.1 + dice.2
- rolltotal = roll + rolltotal
- $CLS
- $PRINTLN "Game Totals: Computer:" COMPUTERTOTAL " You:" USERTOTAL " First player was" firstplayer
- $NEWLINE
- CALL RANDOM(,, TIME(s))
- q = RANDOM(1,20)
- $PRINTLN quote.q
- $NEWLINE
- dicepos1 = random(1,40,time(s))
- dicepos2 = random(dicepos1 + 7,75,time(s))
- $FCOLOUR 0
- $BCOLOUR 7
- $PRINTLN esc"[6;"dicepos1"H "esc"[6;"dicepos2"H "
- $PRINTLN esc"[7;"dicepos1"H "esc"[7;"dicepos2"H "
- $PRINTLN esc"[8;"dicepos1"H "esc"[8;"dicepos2"H "
- SELECT
- WHEN dice.1 = 1 THEN $PRINTLN esc"[7;"dicepos1 + 2"H*"
- WHEN dice.1 = 2 THEN
- DO
- $PRINTLN esc"[6;"dicepos1"H*"
- $PRINTLN esc"[8;"dicepos1 + 4"H*"
- END
- WHEN dice.1 = 3 THEN
- DO
- $PRINTLN esc"[6;"dicepos1"H*"
- $PRINTLN esc"[7;"dicepos1 + 2"H*"
- $PRINTLN esc"[8;"dicepos1 + 4"H*"
- END
- WHEN dice.1 = 4 THEN
- DO
- $PRINTLN esc"[6;"dicepos1"H*"esc"[6;"dicepos1 + 4"H*"
- $PRINTLN esc"[8;"dicepos1"H*"esc"[8;"dicepos1 + 4"H*"
- END
- WHEN dice.1 = 5 THEN
- DO
- $PRINTLN esc"[6;"dicepos1"H*"esc"[6;"dicepos1 + 4"H*"
- $PRINTLN esc"[7;"dicepos1 + 2"H*"
- $PRINTLN esc"[8;"dicepos1"H*"esc"[8;"dicepos1 + 4"H*"
- END
- WHEN dice.1 = 6 THEN
- DO
- $PRINTLN esc"[6;"dicepos1"H*"esc"[6;"dicepos1 + 4"H*"
- $PRINTLN esc"[7;"dicepos1"H*"esc"[7;"dicepos1 + 4"H*"
- $PRINTLN esc"[8;"dicepos1"H*"esc"[8;"dicepos1 + 4"H*"
- END
- END
- SELECT
- WHEN dice.2 = 1 THEN $PRINTLN esc"[7;"dicepos2 + 2"H*"
- WHEN dice.2 = 2 THEN
- DO
- $PRINTLN esc"[6;"dicepos2"H*"
- $PRINTLN esc"[8;"dicepos2 + 4"H*"
- END
- WHEN dice.2 = 3 THEN
- DO
- $PRINTLN esc"[6;"dicepos2"H*"
- $PRINTLN esc"[7;"dicepos2 + 2"H*"
- $PRINTLN esc"[8;"dicepos2 + 4"H*"
- END
- WHEN dice.2 = 4 THEN
- DO
- $PRINTLN esc"[6;"dicepos2"H*"esc"[6;"dicepos2 + 4"H*"
- $PRINTLN esc"[8;"dicepos2"H*"esc"[8;"dicepos2 + 4"H*"
- END
- WHEN dice.2 = 5 THEN
- DO
- $PRINTLN esc"[6;"dicepos2"H*"esc"[6;"dicepos2 + 4"H*"
- $PRINTLN esc"[7;"dicepos2 + 2"H*"
- $PRINTLN esc"[8;"dicepos2"H*"esc"[8;"dicepos2 + 4"H*"
- END
- WHEN dice.2 = 6 THEN
- DO
- $PRINTLN esc"[6;"dicepos2"H*"esc"[6;"dicepos2 + 4"H*"
- $PRINTLN esc"[7;"dicepos2"H*"esc"[7;"dicepos2 + 4"H*"
- $PRINTLN esc"[8;"dicepos2"H*"esc"[8;"dicepos2 + 4"H*"
- END
- END
- $FCOLOUR 7
- $BCOLOUR 0
- IF Player = "COMPUTER" THEN
- $PRINTLN esc"[10;1HThe roll was:" dice.1 dice.2 "Current total:" COMPUTERTOTAL + rolltotal
- ELSE
- $PRINTLN esc"[10;1HThe roll was:" dice.1 dice.2 "Current total:" USERTOTAL + rolltotal
- RETURN
-
- GAME_END:
-
- $CLS
- $PRINTLN "Game Totals: Computer:" COMPUTERTOTAL " You:" USERTOTAL " First player was" firstplayer
- $NEWLINE
- $PRINTLN " We have a winner... and the winner is...."
- $NEWLINE
- CALL DELAY(100)
- IF COMPUTERTOTAL > USERTOTAL THEN
- DO
- $PRINTLN " THE COMPUTER!!!!"
- $PRINTLN "Better luck next time."
- CALL DELAY(300)
- $END
- EXIT
- END
- ELSE
- DO
- $PRINTLN "YOU!!!!"
- $PRINTLN "Job well done."
- CALL DELAY(300)
- $END
- EXIT
- END
-